package com.example.tuShare;

import com.example.tuShare.DTO.FinaIndicatorProperties;
import com.example.tuShare.tuShareService.tushareServiceImpl.TuShareServiceImpl;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
@EnableConfigurationProperties(FinaIndicatorProperties.class)
public class TuShareApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(TuShareApplication.class, args);

        // 获取 TushareFinaIndicator 实例
        TuShareServiceImpl tuShareServiceImpl = context.getBean(TuShareServiceImpl.class);

//        // 调用 fina_indicator 接口
//        String result = tushareFinaIndicatorImpl.callFinaIndicator("600837.SH", "20100331");
//
//        // 解析并导出结果到 Excel
//        if (result != null) {
//            tushareFinaIndicatorImpl.parseAndExportToExcel(result, "FinaIndicator.xlsx");
//        } else {
//            System.out.println("请求失败！");
//        }
    }
}
